export const fieldCover = (otherdata, daydata) => {
  otherdata.forEach((val) => {
    Object.keys(val).forEach((item) => {
      if ((val.day === '环比增幅' || val.day === '同比增幅') && item != 'day') {
        val[item] = val[item] != null ? val[item] + '%' : val[item];
      } else if (
        (item == 'ratio' || item == 'consumeCvr' || item == 'publishCvr') &&
        val[item] != null
      ) {
        val[item] = Number(val[item] * 100).toFixed(2) + '%';
      }
      if (item.indexOf('Percent') != -1) {
        var newItem = item.replace('Percent', '');
        val[newItem] = val[newItem] != null ? val[newItem] : val[item];
      }
    });
  });

  daydata.forEach((val) => {
    Object.keys(val).forEach((item) => {
      if ((item == 'ratio' || item == 'consumeCvr' || item == 'publishCvr') && val[item] != null) {
        val[item] = Number(val[item] * 100).toFixed(2) + '%';
      }
    });
  });
};
